package com.example.yskjproject.model;

import android.os.Parcel;
import android.os.Parcelable;

public class WithDrawalRecordModel implements Parcelable {
    private int id;
    private int user_id;
    private String account;
    private int balance;
    private int state;
    private int status;
    private String apply_at;
    private String finish_at;
    private String created_at;

    public WithDrawalRecordModel(int id, int user_id, String account, int balance, int state, int status,
                                 String apply_at, String finish_at, String created_at) {
        this.id = id;
        this.user_id = user_id;
        this.account = account;
        this.balance = balance;
        this.state = state;
        this.status = status;
        this.apply_at = apply_at;
        this.finish_at = finish_at;
        this.created_at = created_at;
    }

    protected WithDrawalRecordModel(Parcel in) {
        id = in.readInt();
        user_id = in.readInt();
        account = in.readString();
        balance = in.readInt();
        state = in.readInt();
        status = in.readInt();
        apply_at = in.readString();
        finish_at = in.readString();
        created_at = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeInt(user_id);
        dest.writeString(account);
        dest.writeInt(balance);
        dest.writeInt(state);
        dest.writeInt(status);
        dest.writeString(apply_at);
        dest.writeString(finish_at);
        dest.writeString(created_at);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<WithDrawalRecordModel> CREATOR = new Creator<WithDrawalRecordModel>() {
        @Override
        public WithDrawalRecordModel createFromParcel(Parcel in) {
            return new WithDrawalRecordModel(in);
        }

        @Override
        public WithDrawalRecordModel[] newArray(int size) {
            return new WithDrawalRecordModel[size];
        }
    };

    // Getters 和 Setters
    public int getId() { return id; }
    public int getUser_id() { return user_id; }
    public String getAccount() { return account; }
    public int getBalance() { return balance; }
    public int getState() { return state; }
    public int getStatus() { return status; }
    public String getApply_at() { return apply_at; }
    public String getFinish_at() { return finish_at; }
    public String getCreated_at() { return created_at; }
}
